package com.hyz.dto;

import com.hyz.entity.Comment;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author HGD
 * @date 2023/2/12 0:42
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ActionResult {
    private Integer statusCode;
    private String statusMsg;
    private Comment comment;

    public static ActionResult ok(Comment comment) {
        return new ActionResult(0, "", comment);
    }

    public static ActionResult ok(String statusMsg, Comment comment) {
        return new ActionResult(0, statusMsg, comment);
    }

    public static ActionResult ok(String statusMsg) {
        return new ActionResult(0, statusMsg, null);
    }

    public static ActionResult fail() {
        return new ActionResult(1, "", null);
    }

    public static ActionResult fail(String statusMsg) {
        return new ActionResult(1, statusMsg, null);
    }


}
